﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using laba_5;
using WindowsFormsApplication1;


namespace Тхи_5_лаба
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                create_airplanes create = new create_airplanes();
                int kol_Boeing747;
                int kol_AirbusA320;
                int kol_Boeing737;
                int kol_AirbusA340;
                kol_Boeing747 = Convert.ToInt32(textBox1.Text);
                kol_AirbusA320 = Convert.ToInt32(textBox2.Text);
                kol_Boeing737 = Convert.ToInt32(textBox3.Text);
                kol_AirbusA340 = Convert.ToInt32(textBox4.Text);

                Boeing747 Boeing747_ = create.create_Boeing747(kol_Boeing747);
                Boeing737 Boeing737_ = create.create_Boeing737(kol_Boeing737);
                AirbusA320 AirbusA320_ = create.create_AirbusA320(kol_AirbusA320);
                AirbusA340 AirbusA340_ = create.create_AirbusA340(kol_AirbusA340);
                
                company company_ = create.create_company(Boeing747_, AirbusA320_, Boeing737_, AirbusA340_);
                calculater calc = new calculater();

                string str = "общее количество пассажиров " + calc.Calculate(company_);
                MessageBox.Show(str);
            }
            catch (Exception)
            {
                MessageBox.Show("Не ввели данные о самолете");
            }
        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }

        private void textBox3_TextChanged(object sender, EventArgs e)
        {

        }

        private void label2_Click(object sender, EventArgs e)
        {

        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {

        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void textBox4_TextChanged(object sender, EventArgs e)
        {

        }

        private void button2_Clik(object sender, EventArgs e)
        {

        }

    }
}
